package com.monkey.core.plugin.report.pdf;


import java.util.*;

/**
 * Created by silentwu on 2015/6/29.
 */
public class PdfData {
    private String downloadFileName;
    private String reportURL;

    private Map parameters = new HashMap();
    private List fields = new ArrayList();

    private Properties subReportUrls = new Properties();


    public PdfData() {
    }

    /**
     * 添加子报表数据
     *
     * @param key       子报表key
     * @param reportURL 子报表路径
     * @return PdfData
     */
    public PdfData addSubReportUrl(String key, String reportURL) {
        this.subReportUrls.put(key, reportURL);
        return this;
    }

    @SuppressWarnings("unchecked")
    public PdfData addField(Object field) {
        this.fields.add(field);
        return this;
    }

    @SuppressWarnings("unchecked")
    public PdfData addFields(Collection fields) {
        this.fields.addAll(fields);
        return this;
    }

    @SuppressWarnings("unchecked")
    public PdfData addParameter(String key, Object parameter) {
        this.parameters.put(key, parameter);
        return this;
    }

    public String getReportURL() {
        return reportURL;
    }

    public void setReportURL(String reportURL) {
        this.reportURL = reportURL;
    }

    public String getDownloadFileName() {
        return downloadFileName;
    }

    public void setDownloadFileName(String downloadFileName) {
        this.downloadFileName = downloadFileName;
    }

    public Properties getSubReportUrls() {
        return subReportUrls;
    }

    public void setSubReportUrls(Properties subReportUrls) {
        this.subReportUrls = subReportUrls;
    }

    public List getFields() {
        return fields;
    }

    public void setFields(List fields) {
        this.fields = fields;
    }

    public Map getParameters() {
        return parameters;
    }

    public void setParameters(Map parameters) {
        this.parameters = parameters;
    }

}
